There are two types of file character sets in Windows: ANSI and Unicode.For Unicode, Windows supports three of its encoding methods: Small Tail encoding (UNICODE), big tail encoding (bigendianunicode), and UTF-8 encoding.We can identify the encoding of a file from its header. When the first two bytes of the header are FF Fe, the Unicode tail encoding is used. When the first two bytes are Fe ff, the Unicode tail encoding is used; when the two bytes in the header are ef bb, It is the Unicode UTF-8
IV () as Byte = {h12, h34, h56, h78, AMP;H90, hab, AMP;HCD, hef}
Try
' Bykey = System.Text.Encoding.UTF8.GetBytes (Left (Strencrkey, 8))
Bykey = System.Text.Encoding.UTF8.GetBytes (strencrkey.substring (0, 8))
Dim des as New System.Security.Cryptography.DESCryptoServiceProvider
Dim Inputbytearray () as Byte = System.Text.Encoding.UTF8.GetBytes (StrText)
Dim MS as New MemoryStream
Dim CS as New CryptoStream (MS, Des. CreateEncryptor (Bykey, IV), Crypt
Editor.InitializeComponent ()End Sub#End RegionPrivate Sub Page_Load (ByVal sender as System.Object, ByVal e as System.EventArgs) HandlesMyBase.Load' Put user code to initialize the pageLabel1.Text = "If not IsPostBack ThenDim MyList as New ArrayList ()Mylist.add ("Encryption")Mylist.add ("decryption")Radiobuttonlist1.datasource = MyListRadiobuttonlist1.databind ()End IfEnd Sub' EncryptPublic Shared Function Encrypttext (ByVal StrText As String) as StringReturn Encrypt (StrText, "%#@?,:*")End F
Title:You is given a string, s, and a list of words, words, that is all of the same length. Find all starting indices of substring (s) in s that's a concatenation of each word in wordsexactly once And without any intervening characters.for example, given:s : " Barfoothefoobarman " words : [" foo "," Bar "] You should return the indices: [0,9] .(Order does not matter).Test Instructions:Given a string s, and a set of string array words, all string lengths in the array are the same. Find the star
Partial Public Class Encrypttobase64decryptfrombase64class encrypttobase64decryptfrombase64
The public Shared function encrypttobase64string () function encrypttobase64string (ByVal stringtoencryptsql as SqlString, ByVal Sencryptionkeysql as SqlString) as SqlString
Dim Stringtoencrypt As String = CType (Stringtoencryptsql, String)
Dim Sencryptionkey As String = CType (Sencryptionkeysql, String)
Dim IV () as Byte = {h12, h34, h56, h78, AMP;H90, hab, AMP;HCD,
key is generated in the same way. Note A newline character is required at the end of the Authorized_keys file before appending.
Ssh-rsa aaaab3nzac1yc2eaaaaaaaaupeye1nmmrb121244dwhwflspfifrfb1quwqtx2m/ysi8eln3vga/5ahfkkpwg+ noczwzxi0xguiyaslriiowxaujbyei5nhhbcay+gizws4u8h3zu7ugvwmqlqhf8tq/ I0j1rnr6nq8ra9882398akk23h9hhp63eagsbpkefg7qscroq0+vz2yflyjuclgxhb+eah+r9eqq4l%hef; asd8hlqw449w1szkz3hcwxfajfkbj/n+j50vnxb3flnetniq@ooikn324n802do5jizgfznrysirfbjv
Once you have downloaded this file, you can query it.
The following is the detailed code
Copy Code code as follows:
' Querycode.vbs By:fastslz
' Support batch query, can be placed in SendTo extended application
Set files=wscript.arguments
If files. Count=0 Then
MsgBox "Please drag the file you want to query into this file!" ", vbinformation," File Encoding query tool By:fastslz "
End If
For i=0 to files. Count-1
File=files (i)
Call Checkcode ("encoded as:")
Next
code and free to choose whether to add/Remove BOM file headers,
Please leave your email and your URL, I will originate the code to you. Automatic identification of coding ....
There is already a function in the source code (module1.bas \ Filecodingcheck ()),
However, the test is not very accurate, especially in the absence of BOM header files.
Public Function Filecodingcheck (ByVal FilePath as String)
Dim smobj as New ADODB. Stream
Dim SmRead1 As Integer, SmRead2 As Integer, SmRead3 as Integer
System.Text
Imports System.Security.Cryptography
Partial Public Class Encrypttobase64decryptfrombase64class encrypttobase64decryptfrombase64
_
Public Shared function encrypttobase64string () function encrypttobase64string (ByVal stringtoencryptsql as SqlString, ByVal Sencryptionkeysql as SqlString) as SqlString
Dim Stringtoencrypt as String = CType (Stringtoencryptsql, String)
Dim Sencryptionkey as String = CType (Sencryptionkeysql, String)
Dim IV () as Byte = {h12, h34, h56, h78, AMP;H
Recently, Asp-related files cannot be found on the Internet. If someone gets it out early, don't joke about it. After a long time, you can get it done;
Principle: Analyze and determine the UTF-8, Unicode, and ANSI (Simplified Chinese operating system (gb2312) encoding by using the first two bytes of the stream object pre-Read File.
Related Materials:
Supplement:
Xie Xiaoyu reminded me that the previous code is nonsense. ANSI's local code is defined by countries and does not have a fix
Leetcode problem solving substring with concatenation of the all words original questionAn existing set of string words of equal length, to find the starting position of the substring in the original string that exactly contains all the strings in the words.Note the point:
The order in which the results are returned has no relation
Example:Input: s = "Barfoothefoobarman", words = ["foo", "Bar"]Output: [0, 9]Thinking of solving problemsBecause the words in words may be duplicated, t
pathBintou = objstream. Read (2)If ASCB (midb (Bintou, 1, 1) = Hef and ASCB (midb (Bintou, 2, 1) = HBB thenGetcharsetname = "UTF-8"Elseif ASCB (midb (Bintou, 1, 1) = HFF and ASCB (midb (Bintou, 2, 1) = hfe thenGetcharsetname = "Unicode"ElseGetcharsetname = "gb2312"End ifObjstream. CloseSet objstream = nothingEnd Function
Well, after such a piece of code, our transformation is complete! I hope this article will bring some help and inspiration to
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.